<template>
  <div>
    <span v-if="imageUrl==='NULL'">暂无流程图</span>
    <img v-else class="image-center" :src="imageUrl">
  </div>
</template>
<script>
import { process } from '@neu/dcam-ui/api/workOrder'

export default {
  name: 'Process',
  props: {
    workOrderNum: {
      required: false,
      type: String,
      default: 'NULL'
    }
  },
  data() {
    return {
      imageUrl: '',
      fit: 'cover'
    }
  },
  created() {
    process(this.workOrderNum).then(res => {
      if (res) {
        this.imageUrl = window.URL.createObjectURL(res)
      } else {
        this.imageUrl = 'NULL'
      }
    })
  }
}
</script>
<style lang='scss' scoped>

.image-center{
  width:100%;
  padding:8% 5% 0
}

</style>

